home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEMP / GNU / bison / Semantics < prev    next >
Text File  |  1995-06-28  |  1KB  |  26 lines

  1. Semantics
  2. Previous: <Recursion=>Recursion> * Next: <Declarations=>Declaratio> * Up: <Grammar File=>GrammarFil>
  3.  
  4. #Wrap on
  5. {fH3}Defining Language Semantics{f}
  6.  
  7. The grammar rules for a language determine only the syntax.  The semantics
  8. are determined by the semantic values associated with various tokens and
  9. groupings, and by the actions taken when various groupings are recognized.
  10.  
  11. For example, the calculator calculates properly because the value
  12. associated with each expression is the proper number; it adds properly
  13. because the action for the grouping {fEmphasis}{fStrong}x{f} + {fStrong}y{f}{f} is to add
  14. the numbers associated with {fStrong}x{f} and {fStrong}y{f}.
  15.  
  16. #Wrap off
  17. <Value Type=>ValueType>:        Specifying one data type for all semantic values.
  18. <Multiple Types=>MultipleTy>:    Specifying several alternative data types.
  19. <Actions=>Actions>:           An action is the semantic definition of a grammar rule.
  20. <Action Types=>ActionType>:      Specifying data types for actions to operate on.
  21. <Mid-Rule Actions=>MidRuleAct>:  Most actions go at the end of a rule.
  22.                       This says when, why and how to use the exceptional
  23.                         action in the middle of a rule.
  24. #Wrap on
  25.  
  26.